<?php namespace system\database\migrations;
use houdunwang\database\build\Migration;
use houdunwang\database\build\Blueprint;
use houdunwang\database\Schema;
class CreateArticleTable extends Migration {
    //执行
	public function up() {
		Schema::create( 'article', function ( Blueprint $table ) {
            $table->increments( 'art_id' );
            $table->timestamps();
//			$table->string('admin_username',100)->defaults('')->comment('cms后台管理员用户名');
            $table->string('art_title',100)->defaults('')->comment('cms后台文章标题');
            $table->integer('art_click')->unsigned()->defaults(0)->comment('点击次数');
            $table->string('art_content',1000)->defaults('')->comment('cms后台文章内容');
            $table->string('art_description',100)->defaults('')->comment('cms后台文章描述');
            $table->string('art_author',100)->defaults('')->comment('cms后台文章作者');
            $table->string('art_linkurl',100)->defaults('')->comment('cms后台文章外部链接');
            $table->string('art_source',100)->defaults('')->comment('cms后台文章来源');
            $table->tinyInteger('art_iscommed')->defaults( 0 )->comment( '是否推荐' );
            $table->tinyInteger('art_ishot')->defaults( 0 )->comment( '是否热门' );
            $table->tinyInteger('art_sort')->unsigned()->defaults(0)->comment('cms后台排序');
            $table->integer('cate_id')->unsigned()->defaults(0)->comment('栏目主键');
            $table->string('art_keyword',100)->defaults('')->comment('cms后台微信关键词');
        });
    }

    //回滚
    public function down() {
        Schema::drop( 'article' );
    }
}